// 业务员信息
const sequelize = require( '../config.js')
const { DataTypes } = require('sequelize')
const salesmanInfo = sequelize.define('salesmanInfo', {
	Id: {
	  type: DataTypes.INTEGER,
	  primaryKey: true,
	  autoIncrement: true,
	},
	user_id: {
	  type: DataTypes.INTEGER,
	  allowNull: false,
	  references: {
		model: 'userledgers',
		key: 'Id',
	  },
	  onDelete: 'CASCADE',
	  comment:'用户ID'
	},
	user_phone:{
		type:DataTypes.STRING,
		allowNull:false,
		comment:'用户手机号',
	},
	full_name:{
		type:DataTypes.STRING,
		comment:'业务员姓名'
	}
  });


  (async ()=>{
	await salesmanInfo.sync({alter:true});
  })()
  module.exports = salesmanInfo
  